a=[1,2,3,4]
total=0
def sum(a,index):
  global total
  if index>=len(a):
    return
  total+=a[index]
  index+=1
  sum(a,index)
sum(a,0)

# def sum():
#   global total
#   total+=1
# sum()
print(total)